package com.lancoo.znbkxx.adapter;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import java.util.ArrayList;

/**
 * Create by TangJun on 2019/2/16
 */
public class GuideAdapter extends PagerAdapter {
    private ArrayList<ImageView> imageViews;

    public GuideAdapter(ArrayList<ImageView> imageViews) {
        this.imageViews = imageViews;
    }
    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return imageViews.size();
    }
    @Override
    public boolean isViewFromObject(View arg0, Object arg1) {
        // TODO Auto-generated method stub
        return arg0 == arg1;
    }
    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView(imageViews.get(position));
    }
    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        container.addView(imageViews.get(position));
        return imageViews.get(position);
    }

}

